package com.doit.demo04;

import java.util.*;

public class test {
    public static void main(String[] args) {
        HashSet<Integer> has = new HashSet<>();
        has.add(1);
        has.add(7);
        has.add(2);
        has.add(3);
        System.out.println(has);

        System.out.println("-------------------");
        List<Person> list = new ArrayList<Person>();
//                new Comparator<Person>() {
//            @Override
//            public int compare(Person o1, Person o2) {
//                return o1.getAge()-o2.getAge();
//            }
//        });

        list.add(new Person(12,"张三"));
        list.add(new Person(13,"李四"));
        list.add(new Person(11,"王五"));

        System.out.println(list);
    }
}
